home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_lag_intro.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  152 lines

  1. # Jones 3D Cog Script
  2. #
  3. # lag_Intro.cog
  4. #
  5. #    [DS]
  6. #
  7. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ==============================================================================
  10.  
  11. symbols
  12.  
  13.     message     startup
  14.     message     user0
  15.     
  16.     keyframe    in_look=0in_figithat_4_4.key    local
  17.     keyframe    in_think=0in_thinking_4_4.key    local
  18.     keyframe    in_1to4=0in_stand1_bd_4.key        local
  19.     keyframe    in_stand4=0in_stand4.key        local
  20.  
  21.     sound        music0=mus_lag_intro.wav        local
  22.     sound       indyline=lg01j01a.wav            local
  23.  
  24.     thing        player                            local
  25.     thing        campos
  26.     thing        indyactor
  27.     thing        fader                                  # gen_fadeplat thing
  28.     thing        indyCamTarget                    local # var    
  29.  
  30.     vector        v_targetpos                        local
  31.  
  32.     int         track                            local
  33.     int         snd                                local
  34.  
  35.     int            bSeen=0                            local
  36.  
  37. end
  38.  
  39. # ==============================================================================
  40.  
  41. code
  42.  
  43. startup:
  44.  
  45.     SetMasterCog(GetSelfCog()); # RT: Set master cog so we get autosave/restore message
  46.  
  47.     Sleep(0.001); # Let engine get set up
  48.  
  49.     SetThingAlpha(fader, 1.0);
  50.  
  51.     # Start on black...
  52.     SetCameraFocus(2, campos);
  53.     SetCameraSecondaryFocus(2, player);
  54.     SetCameraPosInterp(2, 0);
  55.     SetCameraLookInterp(2, 0);
  56.     SetCurrentCamera(2);
  57.  
  58.     return;
  59.  
  60. # ..............................................................................
  61.  
  62. user0: # RT: Indicates that autosave/restore has completed...
  63.  
  64.     if (bSeen) return; # RT
  65.     bSeen = 1;
  66.  
  67. #   if you're going to switch the camera to start your level cutscene, do it first before anything else!
  68.     SetCameraFocus(2, campos);
  69.     SetCameraSecondaryFocus(2, player);
  70.     SetCameraPosInterp(2, 0);
  71.     SetCameraLookInterp(2, 0);
  72.     SetCurrentCamera(2);
  73.  
  74. #   cutscene camera is set up and set as current, now sleep for 0.01 to let the engine generate a frame
  75.     sleep(0.01);
  76.  
  77. #    then you can do the rest of the stuff you need to start your cutscene.
  78. #   IMPORTANT! -- don't do a StartCutscene() until after the new camera is set and has had a chance
  79. #   to render a frame!
  80.     player = GetLocalPlayerThing();
  81.     SetThingFlags(player, 0x80000);
  82.     SetActorFlags(player, 0x200000);
  83.     ClearThingFlags(indyactor, 0x80000);
  84.     CopyPlayerHolsters(player, indyactor);
  85.     PlaySoundLocal(music0, 1.0, 0.0, 0x0, 0);
  86.     StartCutscene(2);
  87.     AttachThingToThing(fader, campos);
  88.     ThingFadeAnim(fader, 1.0, 0.0, 0.5, 0);
  89.     SetCameraFOV(90, 0, 0);    
  90.     MoveToFrame(campos, 1, 12.0);
  91.     Sleep(0.01);
  92.     SetCameraFOV(45, 1, 11);
  93.     Sleep(0.5);
  94.     DestroyThing(fader);
  95.     Sleep(7.5);
  96.     AISetMoveSpeed(indyactor, 1.0);
  97.     AISetMoveThing(indyactor, player, 0);
  98.     Sleep(1.3);
  99.     MoveToFrame(campos, 1, 10.0);
  100.     Sleep(0.2);
  101.     MoveToFrame(campos, 1, 9.0);
  102.     Sleep(0.2);
  103.     MoveToFrame(campos, 1, 8.0);
  104.     Sleep(0.2);
  105.     MoveToFrame(campos, 1, 7.5);
  106.     Sleep(0.3);
  107.     MoveToFrame(campos, 1, 7.2);
  108.     Sleep(0.4);
  109.     MoveToFrame(campos, 1, 6.9);
  110.     Sleep(0.5);
  111.     MoveToFrame(campos, 1, 6.6);
  112.     Sleep(0.5);
  113.     MoveToFrame(campos, 1, 6.3);
  114.     Sleep(0.5);
  115.     MoveToFrame(campos, 1, 6.0);
  116.     Sleep(0.6);
  117.     MoveToFrame(campos, 1, 5.5);
  118.     Sleep(0.6);
  119.     MoveToFrame(campos, 1, 5.0);
  120.     Sleep(0.6);
  121.     MoveToFrame(campos, 1, 4.5);
  122.     Sleep(0.6);
  123.     MoveToFrame(campos, 1, 4.0);
  124.     Sleep(0.6);
  125.     AIWaitForStop(indyactor);
  126.     track = PlayKey(indyactor, in_Stand4, 2, 0x0, 0);
  127.     PlayKey(indyactor, in_1to4, 4, 0x12, 1);
  128.     snd = PlayVoice(indyactor, indyline, 1.0, 0);
  129.     Sleep(0.3);
  130.     PlayKey(indyactor, in_look, 4, 0x12, 1);
  131.     Sleep(0.7);
  132.     PlayKey(indyactor, in_think, 4, 0x12, 1);
  133.     WaitForSound(snd);
  134.     StopKey(indyactor, track, 0.5);
  135.     SetThingFlags(indyactor, 0x80000);
  136.     ClearThingFlags(player, 0x80000);
  137.  
  138.     # Establish a camera position near Indy and prep follow-cam...            
  139.     ResetCameraFOV(0, 0.0);
  140.     v_targetpos = VectorAdd(VectorTransformToOrient(player, '0.25 -0.1 0.0'), GetThingPos(player));    
  141.     SetCameraPosition(1, v_targetpos);
  142.  
  143.     # Drop into follow-cam mode...
  144.     SetCurrentCamera(1);
  145.     EndCutscene();
  146.     ClearActorFlags(player, 0x200000);
  147.  
  148.     return;
  149.  
  150. end
  151.  
  152.